package com.cu.employmentmanagementsystem.common.enums;

import lombok.Getter;

import java.util.Objects;

/**
 * 删除状态枚举
 *
 * @author CaptainUniverse_
 * @date 2024/3/1
 */
@Getter
public enum IsDeleteFlagEnum
{
    DELETED(1, "已删除"),
    UN_DELETED(0, "未删除");

    private Integer code;
    private String desc;

    IsDeleteFlagEnum(Integer code, String desc)
    {
        this.code = code;
        this.desc = desc;
    }

    public static IsDeleteFlagEnum getByCode(Integer code)
    {
        for (IsDeleteFlagEnum isDeleteFlagEnum : IsDeleteFlagEnum.values())
        {
            if (Objects.equals(isDeleteFlagEnum.getCode(), code))
            {
                return isDeleteFlagEnum;
            }
        }
        return null;
    }
}
